package com.ruoyi.app.service.impl;

import com.ruoyi.app.domain.HtCompareRecord;
import com.ruoyi.app.mapper.HtCompareRecordMapper;
import com.ruoyi.app.service.IHtCompareRecordService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 对比记录Service业务层处理
 */
@Service
public class HtCompareRecordServiceImpl implements IHtCompareRecordService {
    @Autowired
    private HtCompareRecordMapper htCompareRecordMapper;

    /**
     * 查询对比记录列表
     *
     * @param htCompareRecord 对比记录
     * @return 对比记录集合
     */
    @Override
    public List<HtCompareRecord> selectHtCompareRecordList(HtCompareRecord htCompareRecord) {
        return htCompareRecordMapper.selectHtCompareRecordList(htCompareRecord);
    }

    /**
     * 新增对比记录
     *
     * @param htCompareRecord 对比记录
     * @return 结果
     */
    @Override
    public int insertHtCompareRecord(HtCompareRecord htCompareRecord) {
        htCompareRecord.setCreateTime(DateUtils.getNowDate());
        return htCompareRecordMapper.insertHtCompareRecord(htCompareRecord);
    }

    /**
     * 修改对比记录
     *
     * @param htCompareRecord 对比记录
     * @return 结果
     */
    @Override
    public int updateHtCompareRecord(HtCompareRecord htCompareRecord) {
        htCompareRecord.setUpdateTime(DateUtils.getNowDate());
        return htCompareRecordMapper.updateHtCompareRecord(htCompareRecord);
    }

    /**
     * 删除对比记录信息
     *
     * @param id 对比记录主键
     * @return 结果
     */
    @Override
    public int deleteHtCompareRecordById(Long id) {
        return htCompareRecordMapper.deleteHtCompareRecordById(id);
    }

    /**
     * 查询对比记录详细
     *
     * @param id 对比记录主键
     * @return 对比记录
     */
    @Override
    public HtCompareRecord selectHtCompareRecordById(Long id) {
        return htCompareRecordMapper.selectHtCompareRecordById(id);
    }
}
